package com.utn.ab.user.mapper;

import com.utn.ab.user.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @创建人 liuchunlin
 * @创建时间 9:29
 * @描述
 */
@Mapper
public interface UserMapper {

    @Insert("insert into advert_user (id,name,password,birth,mobile,createTime,updateTime,state) values " +
            "(#{id},#{name},#{password},#{birth},#{mobile},#{createTime},#{updateTime},#{state})")
    int save(User user);

    @Select("select * from advert_user where name = #{name}")
    List<User> listByName(String name);

    @Select("select * from advert_user where mobile = #{mobile}")
    List<User> listByMobile(String mobile);
}
